package com.tubi.阻塞队列;

import java.util.concurrent.ArrayBlockingQueue;

public class demo {
    public static void main(String[] args) throws InterruptedException {
//        阻塞队列的基本用法
        //创建阻塞队列 容量为1
        ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue<>(1);

        arrayBlockingQueue. put("汉堡包");

        String a = arrayBlockingQueue.take();
        System.out.println(a);
    }
}
